package se.kth.fericss.menu;

import java.awt.event.*;
import java.awt.*;
import javax.swing.*;

public class MainMenu extends JComponent{

	/**
	 * 
	 */
	private int width;
	private int height;
	private ActionListener Action;
	private static final long serialVersionUID = 1L;

	
	public MenuButton 	exit  	= new MenuButton("Exit"),
    							close 	= new MenuButton("Close menu"),
    							newGame = new MenuButton("New Game");
	public MainMenu(ActionListener ac){
		width=200;
		height=500;
		Action=ac;
		makeMenu();
	}
	public int getWidth(){
		return width;
	}
	public int getHeight(){
		return height;
	}
	public void makeMenu(){
		
        exit.addActionListener(Action);
        exit.setLocation(30,150);
        exit.setSize(140,40);
        
        newGame.setSize(140,40);
        newGame.addActionListener(Action);
        newGame.setLocation(30,50);
        
        close.setSize(140,40);
        close.addActionListener(Action);
        close.setLocation(30,100);
        
        this.setOpaque(true);
        setSize(width,height);
        //setBackground(new Color(180,10,50));
        add(exit);
        add(newGame);
        add(close);
	}
	public void hideMenu(){
		this.setVisible(false);
	}
	public void showMenu(){
		this.setVisible(true);
	}
	

}
